import React from 'react';
import { connect } from 'dva';
import styles from './Logins.css';
function Logins(props) {
  let dispatch = props.dispatch;
  let url = window.location.search;
  let code = url.substring(1, url.length).split("&")[0].split("=")[1];
  // console.log("state--",state)
  let state=url.substring(1,url.length).split("&")[1].split("=")[1];//state==1为手机端客户，state==2位电脑端客户
  console.log(state);
  //电脑端登录
  if(state==2){
    console.log(code);
    //电脑端
    dispatch({type: 'logins/mlogin', payload: code});
  }else if(state==3){
    console.log(code);
    //电脑端
    dispatch({type: 'logins/plogin', payload: code});
  }

  return (
    <div className={styles.normal}>
     正在登录，请稍后......
    </div>
  );
}

function mapStateToProps() {
  return {};
}

export default connect(mapStateToProps)(Logins);
